﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WebStudio.Mvc.Core.Helper;
using System.Web.Mvc.Html;
using System.Web.Routing;

namespace WebStudio.Mvc.Core.Extensions
{

    /// <summary>
    /// 附件控件扩展
    /// </summary>
    public static class AccessoryExtension
    {
        /// <summary>
        /// 附件呈现控件
        /// </summary>
        /// <param name="xhtml"></param>
        /// <param name="accessoryID"></param>
        /// <param name="enableEdit"></param>
        public static void Accessory(this XHtmlHelper xhtml, int accessoryID, bool enableEdit)
        {
            RouteValueDictionary routes = new RouteValueDictionary();
            routes.Add("accessoryID", accessoryID);
            routes.Add("ListItemWidth", "50%");
            routes.Add("Area", "Common");
            routes.Add("InitialVerNo", 0);
            routes.Add("MaxVerNo", 999);

            xhtml.Html.RenderAction("Show", "Accessory", routes);
        }
    }
}
